package com.tac.controller.mes;

import com.github.pagehelper.PageInfo;
import com.tac.common.result.Result;
import com.tac.pojo.mes.TechnologyModeling;
import com.tac.service.mes.TechnologyModelingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/technologyModeling")
@RestController
@Api(tags = "制造执行MES--工艺建模")
@CrossOrigin
public class TechnologyModelingController {
    /**
     * 工艺建模是指将产品的生产工艺进行分析、设计、优化和管理，建立工艺模型，对工艺的各种参数和过程进行描述和管理。
     * 工艺建模的主要目的是为了实现生产工艺的精细化管理和控制，确保生产过程的稳定性和生产效率。
     */
    @Autowired
    private TechnologyModelingService technologyModelingService;

    //查看工艺建模
    @ApiOperation("查看工艺建模")
    @GetMapping("/getList")
    public Result<PageInfo<TechnologyModeling>> getList(Integer pageNum, Integer pageSize, String name){
       return technologyModelingService.getList(pageNum, pageSize, name);
    }
    //添加工艺建模
    @ApiOperation("添加工艺建模")
    @PostMapping("/save")
    public Result save(@RequestBody TechnologyModeling technologyModeling){
        return technologyModelingService.save(technologyModeling);
    }
    //删除工艺建模
    @ApiOperation("删除工艺建模")
    @DeleteMapping("/remove")
    public Result remove(@RequestBody List<Integer> ids){
        return technologyModelingService.remove(ids);
    }
    //修改工艺建模
    @ApiOperation("修改工艺建模")
    @PutMapping("/update")
    public Result update(@RequestBody TechnologyModeling technologyModeling){
        return technologyModelingService.update(technologyModeling);
    }
}
